<template>
  <div class="video">
    <div class="title-wrapper">
      <span class='tag'>MV</span>
      <span class='title'>{{ mvming }}</span>
      <span class='artist'>{{ mvzuozhe }}</span>
    </div>
    <video :src="ship" controls></video>
  </div>
</template>

<script>
export default {
  data(){
    return {
      // 视频
      ship:'',
      // mv名
      mvming:'',
      // mv作者
      mvzuozhe:''
    }
  },
  async created(){
    if(!this.$route.params.mvid){z
      alert('未检出歌曲id信息')
      // 后退一步
      window.history.back(-1)
      return
    }
    //mv发起请求
    let sre=await this.$axios.get('/mv/url?id=' + this.$route.params.mvid)
    // console.log(sre);
    this.ship = sre.data.data.url
    //视频信息请求
    let rre=await this.$axios.get("/mv/detail?mvid="+this.$route.params.mvid)
    console.log(rre);
    this.mvming = rre.data.data.name
    this.mvzuozhe = rre.data.data.artistName
  }
}
</script>

<style scoped>
@import "@/assets/css/video.css";
</style>